package main

import "fmt"

func Producer(out chan<- int) {

	for i := 0; i < 10; i++ {
		out <- i * i
	}
	close(out)
}

func Consumer(in <-chan int) {
	for v := range in { //循环读取channel中的数据
		fmt.Printf("num = %d\r\n", v)
	}
}

func dingyi() {

	send := make(chan<- int)
	read := make(<-chan int)
	fmt.Println(send)
	fmt.Println(read)

}
